package org.example.admin.service;

import org.example.common.utils.CommonUtil;
import org.example.db.entity.Permission;
import org.example.security.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class AdminPermissionService {

    PermissionService permissionService;


    public AdminPermissionService(PermissionService permissionService) {
        this.permissionService = permissionService;
    }

    public void addPermission(Permission permission){

        int count = permissionService.addPermission(permission);
        CommonUtil.isSqlExcute(count);
    }

    public List<Permission> getPermission(){


        return permissionService.getPermissionList();
    }
}
